3.1.22 \(\int \frac {\csc ^4(x)}{a+b \cos ^2(x)} \, dx\) [22]

Optimal. Leaf size=61 \[ -\frac {b^2 \text {ArcTan}\left (\frac {\sqrt {a+b} \cot (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)^{5/2}}-\frac {(a+2 b) \cot (x)}{(a+b)^2}-\frac {\cot ^3(x)}{3 (a+b)} \]

[Out]

-(a+2*b)*cot(x)/(a+b)^2-1/3*cot(x)^3/(a+b)-b^2*arctan(cot(x)*(a+b)^(1/2)/a^(1/2))/(a+b)^(5/2)/a^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3270, 398, 211} \begin {gather*} -\frac {b^2 \text {ArcTan}\left (\frac {\sqrt {a+b} \cot (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)^{5/2}}-\frac {\cot ^3(x)}{3 (a+b)}-\frac {(a+2 b) \cot (x)}{(a+b)^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[x]^4/(a + b*Cos[x]^2),x]

[Out]

-((b^2*ArcTan[(Sqrt[a + b]*Cot[x])/Sqrt[a]])/(Sqrt[a]*(a + b)^(5/2))) - ((a + 2*b)*Cot[x])/(a + b)^2 - Cot[x]^
3/(3*(a + b))

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 398

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Int[PolynomialDivide[(a + b*x^n)
^p, (c + d*x^n)^(-q), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && IGtQ[p, 0] && ILt
Q[q, 0] && GeQ[p, -q]

Rule 3270

Int[cos[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = FreeF
actors[Tan[e + f*x], x]}, Dist[ff/f, Subst[Int[(a + (a + b)*ff^2*x^2)^p/(1 + ff^2*x^2)^(m/2 + p + 1), x], x, T
an[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[m/2] && IntegerQ[p]

Rubi steps

\begin {align*} \int \frac {\csc ^4(x)}{a+b \cos ^2(x)} \, dx &=-\text {Subst}\left (\int \frac {\left (1+x^2\right )^2}{a+(a+b) x^2} \, dx,x,\cot (x)\right )\\ &=-\text {Subst}\left (\int \left (\frac {a+2 b}{(a+b)^2}+\frac {x^2}{a+b}+\frac {b^2}{(a+b)^2 \left (a+(a+b) x^2\right )}\right ) \, dx,x,\cot (x)\right )\\ &=-\frac {(a+2 b) \cot (x)}{(a+b)^2}-\frac {\cot ^3(x)}{3 (a+b)}-\frac {b^2 \text {Subst}\left (\int \frac {1}{a+(a+b) x^2} \, dx,x,\cot (x)\right )}{(a+b)^2}\\ &=-\frac {b^2 \tan ^{-1}\left (\frac {\sqrt {a+b} \cot (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)^{5/2}}-\frac {(a+2 b) \cot (x)}{(a+b)^2}-\frac {\cot ^3(x)}{3 (a+b)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.24, size = 59, normalized size = 0.97 \begin {gather*} \frac {b^2 \text {ArcTan}\left (\frac {\sqrt {a} \tan (x)}{\sqrt {a+b}}\right )}{\sqrt {a} (a+b)^{5/2}}-\frac {\cot (x) \left (2 a+5 b+(a+b) \csc ^2(x)\right )}{3 (a+b)^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Csc[x]^4/(a + b*Cos[x]^2),x]

[Out]

(b^2*ArcTan[(Sqrt[a]*Tan[x])/Sqrt[a + b]])/(Sqrt[a]*(a + b)^(5/2)) - (Cot[x]*(2*a + 5*b + (a + b)*Csc[x]^2))/(
3*(a + b)^2)

________________________________________________________________________________________

Maple [A]
time = 0.18, size = 57, normalized size = 0.93

method result size
default \(-\frac {1}{3 \left (a +b \right ) \tan \left (x \right )^{3}}-\frac {a +2 b}{\left (a +b \right )^{2} \tan \left (x \right )}+\frac {b^{2} \arctan \left (\frac {a \tan \left (x \right )}{\sqrt {\left (a +b \right ) a}}\right )}{\left (a +b \right )^{2} \sqrt {\left (a +b \right ) a}}\) \(57\)
risch \(-\frac {2 i \left (3 b \,{\mathrm e}^{4 i x}-6 a \,{\mathrm e}^{2 i x}-12 b \,{\mathrm e}^{2 i x}+2 a +5 b \right )}{3 \left ({\mathrm e}^{2 i x}-1\right )^{3} \left (a +b \right )^{2}}-\frac {b^{2} \ln \left ({\mathrm e}^{2 i x}+\frac {2 i a^{2}+2 i a b +2 a \sqrt {-a^{2}-a b}+b \sqrt {-a^{2}-a b}}{b \sqrt {-a^{2}-a b}}\right )}{2 \sqrt {-a^{2}-a b}\, \left (a +b \right )^{2}}+\frac {b^{2} \ln \left ({\mathrm e}^{2 i x}+\frac {-2 i a^{2}-2 i a b +2 a \sqrt {-a^{2}-a b}+b \sqrt {-a^{2}-a b}}{b \sqrt {-a^{2}-a b}}\right )}{2 \sqrt {-a^{2}-a b}\, \left (a +b \right )^{2}}\) \(222\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(x)^4/(a+b*cos(x)^2),x,method=_RETURNVERBOSE)

[Out]

-1/3/(a+b)/tan(x)^3-(a+2*b)/(a+b)^2/tan(x)+b^2/(a+b)^2/((a+b)*a)^(1/2)*arctan(a*tan(x)/((a+b)*a)^(1/2))

________________________________________________________________________________________

Maxima [A]
time = 0.48, size = 70, normalized size = 1.15 \begin {gather*} \frac {b^{2} \arctan \left (\frac {a \tan \left (x\right )}{\sqrt {{\left (a + b\right )} a}}\right )}{\sqrt {{\left (a + b\right )} a} {\left (a^{2} + 2 \, a b + b^{2}\right )}} - \frac {3 \, {\left (a + 2 \, b\right )} \tan \left (x\right )^{2} + a + b}{3 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \tan \left (x\right )^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)^4/(a+b*cos(x)^2),x, algorithm="maxima")

[Out]

b^2*arctan(a*tan(x)/sqrt((a + b)*a))/(sqrt((a + b)*a)*(a^2 + 2*a*b + b^2)) - 1/3*(3*(a + 2*b)*tan(x)^2 + a + b
)/((a^2 + 2*a*b + b^2)*tan(x)^3)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 166 vs. \(2 (51) = 102\).
time = 0.46, size = 396, normalized size = 6.49 \begin {gather*} \left [\frac {4 \, {\left (2 \, a^{3} + 7 \, a^{2} b + 5 \, a b^{2}\right )} \cos \left (x\right )^{3} + 3 \, {\left (b^{2} \cos \left (x\right )^{2} - b^{2}\right )} \sqrt {-a^{2} - a b} \log \left (\frac {{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \left (x\right )^{4} - 2 \, {\left (4 \, a^{2} + 3 \, a b\right )} \cos \left (x\right )^{2} + 4 \, {\left ({\left (2 \, a + b\right )} \cos \left (x\right )^{3} - a \cos \left (x\right )\right )} \sqrt {-a^{2} - a b} \sin \left (x\right ) + a^{2}}{b^{2} \cos \left (x\right )^{4} + 2 \, a b \cos \left (x\right )^{2} + a^{2}}\right ) \sin \left (x\right ) - 12 \, {\left (a^{3} + 3 \, a^{2} b + 2 \, a b^{2}\right )} \cos \left (x\right )}{12 \, {\left (a^{4} + 3 \, a^{3} b + 3 \, a^{2} b^{2} + a b^{3} - {\left (a^{4} + 3 \, a^{3} b + 3 \, a^{2} b^{2} + a b^{3}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}, \frac {2 \, {\left (2 \, a^{3} + 7 \, a^{2} b + 5 \, a b^{2}\right )} \cos \left (x\right )^{3} + 3 \, {\left (b^{2} \cos \left (x\right )^{2} - b^{2}\right )} \sqrt {a^{2} + a b} \arctan \left (\frac {{\left (2 \, a + b\right )} \cos \left (x\right )^{2} - a}{2 \, \sqrt {a^{2} + a b} \cos \left (x\right ) \sin \left (x\right )}\right ) \sin \left (x\right ) - 6 \, {\left (a^{3} + 3 \, a^{2} b + 2 \, a b^{2}\right )} \cos \left (x\right )}{6 \, {\left (a^{4} + 3 \, a^{3} b + 3 \, a^{2} b^{2} + a b^{3} - {\left (a^{4} + 3 \, a^{3} b + 3 \, a^{2} b^{2} + a b^{3}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)^4/(a+b*cos(x)^2),x, algorithm="fricas")

[Out]

[1/12*(4*(2*a^3 + 7*a^2*b + 5*a*b^2)*cos(x)^3 + 3*(b^2*cos(x)^2 - b^2)*sqrt(-a^2 - a*b)*log(((8*a^2 + 8*a*b +
b^2)*cos(x)^4 - 2*(4*a^2 + 3*a*b)*cos(x)^2 + 4*((2*a + b)*cos(x)^3 - a*cos(x))*sqrt(-a^2 - a*b)*sin(x) + a^2)/
(b^2*cos(x)^4 + 2*a*b*cos(x)^2 + a^2))*sin(x) - 12*(a^3 + 3*a^2*b + 2*a*b^2)*cos(x))/((a^4 + 3*a^3*b + 3*a^2*b
^2 + a*b^3 - (a^4 + 3*a^3*b + 3*a^2*b^2 + a*b^3)*cos(x)^2)*sin(x)), 1/6*(2*(2*a^3 + 7*a^2*b + 5*a*b^2)*cos(x)^
3 + 3*(b^2*cos(x)^2 - b^2)*sqrt(a^2 + a*b)*arctan(1/2*((2*a + b)*cos(x)^2 - a)/(sqrt(a^2 + a*b)*cos(x)*sin(x))
)*sin(x) - 6*(a^3 + 3*a^2*b + 2*a*b^2)*cos(x))/((a^4 + 3*a^3*b + 3*a^2*b^2 + a*b^3 - (a^4 + 3*a^3*b + 3*a^2*b^
2 + a*b^3)*cos(x)^2)*sin(x))]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\csc ^{4}{\left (x \right )}}{a + b \cos ^{2}{\left (x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)**4/(a+b*cos(x)**2),x)

[Out]

Integral(csc(x)**4/(a + b*cos(x)**2), x)

________________________________________________________________________________________

Giac [A]
time = 0.43, size = 90, normalized size = 1.48 \begin {gather*} \frac {{\left (\pi \left \lfloor \frac {x}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (x\right )}{\sqrt {a^{2} + a b}}\right )\right )} b^{2}}{{\left (a^{2} + 2 \, a b + b^{2}\right )} \sqrt {a^{2} + a b}} - \frac {3 \, a \tan \left (x\right )^{2} + 6 \, b \tan \left (x\right )^{2} + a + b}{3 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \tan \left (x\right )^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)^4/(a+b*cos(x)^2),x, algorithm="giac")

[Out]

(pi*floor(x/pi + 1/2)*sgn(a) + arctan(a*tan(x)/sqrt(a^2 + a*b)))*b^2/((a^2 + 2*a*b + b^2)*sqrt(a^2 + a*b)) - 1
/3*(3*a*tan(x)^2 + 6*b*tan(x)^2 + a + b)/((a^2 + 2*a*b + b^2)*tan(x)^3)

________________________________________________________________________________________

Mupad [B]
time = 2.34, size = 67, normalized size = 1.10 \begin {gather*} \frac {b^2\,\mathrm {atan}\left (\frac {\sqrt {a}\,\mathrm {tan}\left (x\right )\,\left (a^2+2\,a\,b+b^2\right )}{{\left (a+b\right )}^{5/2}}\right )}{\sqrt {a}\,{\left (a+b\right )}^{5/2}}-\frac {\frac {1}{3\,\left (a+b\right )}+\frac {{\mathrm {tan}\left (x\right )}^2\,\left (a+2\,b\right )}{{\left (a+b\right )}^2}}{{\mathrm {tan}\left (x\right )}^3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sin(x)^4*(a + b*cos(x)^2)),x)

[Out]

(b^2*atan((a^(1/2)*tan(x)*(2*a*b + a^2 + b^2))/(a + b)^(5/2)))/(a^(1/2)*(a + b)^(5/2)) - (1/(3*(a + b)) + (tan
(x)^2*(a + 2*b))/(a + b)^2)/tan(x)^3

________________________________________________________________________________________